package com.tjsinfo.tjsoa.messageImportant.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.common.ToolKit;
import com.tjsinfo.tjsoa.messageImportant.bo.IMessageImportantInceptBo;
import com.tjsinfo.tjsoa.system.bo.ISystemUserBo;
import com.tjsinfo.tjsoa.system.vo.TSystemUser;
import com.tjsinfo.tjsoa.system.vo.User;

public class LoginReceiveMainAction extends Action{
	private IMessageImportantInceptBo importantInceptBo;
	private ISystemUserBo tjsUserBo;

	public ISystemUserBo getTjsUserBo() {
		return tjsUserBo;
	}

	public void setTjsUserBo(ISystemUserBo tjsUserBo) {
		this.tjsUserBo = tjsUserBo;
	}
	public IMessageImportantInceptBo getImportantInceptBo() {
		return importantInceptBo;
	}

	public void setImportantInceptBo(IMessageImportantInceptBo importantInceptBo) {
		this.importantInceptBo = importantInceptBo;
	}
	
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		HttpSession session = request.getSession();
		User user = (User) session.getAttribute("user");
		String url = "ok";
		String nowSQL = ToolKit.getProperties("com/tjsinfo/tjsoa/mail/properties/systemResource.properties", this).getProperty("nowSQL");
		List list = importantInceptBo.findByReceiveUser(user.getUser_id(),nowSQL,request.getParameter("orderType"),request.getParameter("order"));
		request.setAttribute("list", list);
		return mapping.findForward(url);
	}

	
}
